<template>
  <div>
    <el-table-column :show-overflow-tooltip="true" label="状态" prop="dataStatus" :width="parent.colWidths.dataStatus?parent.colWidths.dataStatus:100">
      <template slot-scope="scope">
        <span v-if="scope.row.dataStatus === -1" style="color:red">
          <validateMsg :item="scope.row" :type="1" />
          {{ showNameByValue(-1, parent.getSelector().dataStatusList) }}
        </span>
        <span v-else-if="scope.row.dataStatus === 1 && scope.row.promptMsg !== null && scope.row.promptMsg !== ''" style="color:#EC8131">
          <validateMsg :item="scope.row" :type="1" />
          {{ showNameByValue(scope.row.dataStatus, parent.getSelector().dataStatusList) }}
        </span>
        <span v-else-if="scope.row.dataStatus === 1 && (scope.row.promptMsg === null || scope.row.promptMsg === '')" style="color:green">
          {{ showNameByValue(scope.row.dataStatus, parent.getSelector().dataStatusList) }}
        </span>
        <span v-else-if="scope.row.dataStatus === 2" style="color:#409EFF">
          {{ showNameByValue(scope.row.dataStatus, parent.getSelector().dataStatusList) }}
        </span>
        <span v-else-if="scope.row.dataStatus === 3" style="color:#67C23A">
          {{ showNameByValue(scope.row.dataStatus, parent.getSelector().dataStatusList) }}
        </span>
        <span v-else-if="scope.row.dataStatus === 4" style="color:red">
          <rejectMsg :item="scope.row" :type="1" />
          {{ showNameByValue(scope.row.dataStatus, parent.getSelector().dataStatusList) }}
        </span>
        <span v-else>{{ showNameByValue(scope.row.dataStatus, parent.getSelector().dataStatusList) }}</span>
      </template>
    </el-table-column>
  </div>
</template>
<script>
import validateMsg from './validateMsg'
import rejectMsg from './rejectMsg'
import { showNameByValue } from '@/utils/selectUtil'

export default {
  components: { validateMsg, rejectMsg },
  props: {
    parent: {
      type: Object,
      default: null
    }
  },
  methods: {
    showNameByValue
  }
}
</script>

